package insertpackage;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import javabean.Employee;

public class Insertemp extends Insert{
	public void insertDB(Employee emp) {
        Connection conn = null;
        PreparedStatement pstmt = null;
        
        try {
        	conn = getConnection();

            pstmt = conn.prepareStatement("insert into EMPLOYEE values (?,?,?,?,?,?,?,?,?,?)");
            pstmt.setString(1, emp.getEmpID());
            pstmt.setString(2, emp.getEmpPW());
            pstmt.setString(3, emp.getEmpGRADE());
            pstmt.setString(4, emp.getEmpPART());
            pstmt.setString(5, emp.getEmpROLE());
            pstmt.setString(6, emp.getEmpNAME());
            pstmt.setString(7, emp.getEmpADDR());
            pstmt.setString(8, emp.getEmpCALL());
            pstmt.setString(9, emp.getEmpMAIL());
            pstmt.setInt(10, emp.getEmpPAY());
            
            pstmt.executeUpdate();
        } catch(SQLException ex) {
            //throw new EmployeeManagerException("insertEmployee", ex);
        } finally {
            if (pstmt != null) try { pstmt.close(); } catch(SQLException ex) {}
            if (conn != null) try { conn.close(); } catch(SQLException ex) {}
        }
    }
}